from django.urls import re_path,include
from .views import RegisterView, LoginView, LogoutView, get_online_users, get_available_staff, get_nearby_users
from rest_framework.routers import DefaultRouter
from .apis import UserViewSet


router = DefaultRouter()
router.register(r'user', UserViewSet, basename='user')


urlpatterns = [
    re_path(r'^register/', RegisterView.as_view(), name='register'),
    re_path(r'^login/', LoginView.as_view(), name='login'),
    re_path(r'^logout/', LogoutView.as_view(), name='logout'),
    re_path(r'^online_users/', get_online_users, name='online_users'),
    re_path(r'^available_staff/', get_available_staff, name='available_staff'),
    re_path(r'^nearby_users/', get_nearby_users, name='nearby_users'),
    re_path(r'^api/', include((router.urls, 'chat-api'),
            namespace='chat-api')),  # 接口地址
]
